package com.swancloud.openstack.version.internal;

import com.swancloud.api.version.VersionService;
import com.swancloud.model.compute.Version;
import com.swancloud.openstack.version.demon.ApisVersion;
import com.swancloud.openstack.compute.internal.BaseComputeServices;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Server Operation API implementation
 *
 * @author Jeremy Unruh
 */
public class ApisVersionServiceImpl extends BaseComputeServices implements VersionService {

    private static final Logger LOG = LoggerFactory.getLogger(ApisVersionServiceImpl.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public List<? extends Version> list() {
        return get(ApisVersion.Versions.class,uri("/")).execute().getList();
    }


    /**
     * {@inheritDoc}
     */
    @Override
    public Version get() {
        return get(ApisVersion.class, uri("")).execute();
    }


}
